package com.sky.controller.user;

import com.sky.dto.OrdersPaymentDTO;
import com.sky.dto.UserLoginDTO;
import com.sky.result.Result;
import com.sky.service.OrderService;
import com.sky.service.UserService;
import com.sky.vo.OrderPaymentVO;
import com.sky.vo.UserLoginVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/user/user")
@Api(tags = {"用户管理接口"})
public class UserController {
    @Autowired
    UserService userService;

    @PostMapping("/login")
    @ApiOperation("用户登录")
    public Result<UserLoginVO> login(@RequestBody UserLoginDTO dto){
        log.info("用户{}请求登录",dto);
        UserLoginVO userLoginVO = userService.login(dto);
        return Result.success(userLoginVO);
    }

}
